package com.example.yulu.applicationdemo;

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

	private Activity activity = null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		activity = this;
		Button abrir = (Button) findViewById(R.id.button);
		Button abrir2 = (Button) findViewById(R.id.button2);
		abrir.setOnClickListener(this);
		abrir2.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		DialogFragmentWindow fragmentWindow = new DialogFragmentWindow();
		Bundle args = new Bundle();
		args.putString("first", "这是第一个浮层");
		args.putString("second", "这是第二个浮层");

		switch (v.getId()) {

			case R.id.button:
				args.putString("from", "one");
				fragmentWindow.setArguments(args);
				fragmentWindow.show(getSupportFragmentManager(), "");
				break;
			case R.id.button2:
				args.putString("from", "two");
				fragmentWindow.setArguments(args);
				fragmentWindow.show(getSupportFragmentManager(), "");
				break;
		}
	}
}
